import { Result } from "~/models/HomePage/index";

export function getMenu(instance, val: string) {
  const { $axios } = instance;
  return new Promise((resolve, reject) => {
    $axios({
      url: "/new/menu",
      method: "get"
    }).then(res => {
      let value: Result = {
        status: 0,
        data: {}
      };
      if (res && res.data.data) {
        value.status = 0;
        value.data = res.data.data;
        resolve(value);
      } else {
        value.status = 1;
      }
    });
  });
}
